package in.careerscale.apps.ocms.dao.model;

// Generated Jul 7, 2013 10:49:55 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Organization generated by hbm2java
 */
@Entity
@Table(name = "organization", catalog = "ocms")
public class Organization implements java.io.Serializable {

	private Integer id;
	private OrgType orgType;
	private String name;
	private String address;
	private String description;
	private Set loginMasters = new HashSet(0);

	public Organization() {
	}

	public Organization(OrgType orgType, String name, String address,
			String description) {
		this.orgType = orgType;
		this.name = name;
		this.address = address;
		this.description = description;
	}

	public Organization(OrgType orgType, String name, String address,
			String description, Set loginMasters) {
		this.orgType = orgType;
		this.name = name;
		this.address = address;
		this.description = description;
		this.loginMasters = loginMasters;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "org_type_id", nullable = false)
	public OrgType getOrgType() {
		return this.orgType;
	}

	public void setOrgType(OrgType orgType) {
		this.orgType = orgType;
	}

	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "address", nullable = false)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "description", nullable = false)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "user_organization", catalog = "ocms", joinColumns = { @JoinColumn(name = "org_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<LoginMaster> getLoginMasters()
	{
		return this.loginMasters;
	}

	public void setLoginMasters(Set<LoginMaster> loginMasters)
	{
		this.loginMasters = loginMasters;
	}

}
